<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ page
	import="com.onlineMIS.common.Common_util,java.util.Date,java.text.SimpleDateFormat"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>禧乐仓连锁店管理信息系统</title>
<%@ include file="../../common/Style.jsp"%>

<script>

$(document).ready(function(){
	parent.$.messager.progress('close'); 

	var params = $.serializeObject($('#preGenReportForm'));
	
	$('#dataGrid').datagrid({
		url : 'financeHQJSON!generateFinanceRpt',
		queryParams: params,
		fit : true,
		fitColumns : false,
		pagination : false,
		border : false,
		checkOnSelect : false,
		selectOnCheck : false,
		singleSelect:true,
		showFooter:true,
		rownumbers:true,
		nowrap : false,
		rowStyler: function(index,row){
			var style = "";
			if (row.status == 3)
				style += 'color:red;';

			return style;
		},
	columns : [ [ {
				field : 'financeBillId',
				width : 70,
				title : '单据号',
				formatter : function(value, row, index) {
					return row.financeBillId;
				}
			}, {
				field : 'custName',
				width : 140,
				title : '客户',
				formatter : function(value, row, index) {
					return row.custName;
				}
			}, {
				field : 'financeBillType',
				width : 150,
				title : '单据类型',
				formatter : function(value, row, index) {
					return row.financeBillType;
				}
			},{
				field : 'statusS',
				width : 150,
				title : '单据状态',
				formatter : function(value, row, index) {
					return row.statusS;
				}
			},{
				field : 'billDate',
				width : 130,
				title : '单据时间',
				formatter : function(value, row, index) {
					return row.billDate;
				}
			},{
				field : 'itemName',
				width : 120,
				title : '银行卡',
				formatter : function(value, row, index) {
					return row.itemName;
				}
			}, {
				field : 'payValue',
				width : 100,
				title : '付款',
				formatter : function(value, row, index) {
					return row.payValue;
				}
			}, {
				field : 'receiptValue',
				width : 100,
				title : '收款',
				formatter : function(value, row, index) {
					return row.receiptValue;
				}
			},{
				field : 'createBy',
				width : 120,
				title : '创建人',
				formatter : function(value, row, index) {
					return row.createBy;
				}
			},{
				field : 'createTime',
				width : 160,
				title : '创建时间',
				formatter : function(value, row, index) {
					return row.createTime;
				}
			},{
				field:'details', 
				width: 200,
				title:'详情',
				formatter : function(value, row, index) {
					var str = '';
					var url = "financeHQJSP!getFHQ?formBean.financeBill.id=" + row.financeBillId;
					var nodeTitle = "财务单据"+ row.financeBillId;
					if (row.id != 0){							  					
						 str += $.formatString('<a href="javascript:addTab3(\'{0}\',\'{1}\');"><img border="0" src="{2}" title="详情"/></a>',url,nodeTitle,'<%=request.getContextPath()%>/conf_files/easyUI/themes/icons/update.png');							
					}
					return str;
				}
			}

			] ],
			toolbar : '#toolbar',
		});
	});

	function searchAcctFlow() {
		var params = $.serializeObject($('#preGenReportForm'));
		$('#dataGrid').datagrid('load', params);
	}
	
	function downloadAcctFlow(){
		 $.messager.alert('提示','该功能暂未完成!','info');
	}

</script>
</head>
<body>	
	
		
<div class="easyui-layout" data-options="fit : true,border : false">
	<div data-options="region:'north',border:false" style="height: 125px;">
	<s:form id="preGenReportForm" name="preGenReportForm"
		action="financeHQJSP!downloadAcctFlow" 
		theme="simple" method="POST">
		<table width="98%" align="center" class="OuterTable">
			<tr>
				<td>
					<table width="100%" border="0">
						<tr>
							<td height="50" colspan="7">
								<div class="errorAndmes">
									<s:actionerror cssStyle="color:red" />
									<s:actionmessage cssStyle="color:blue" />
								</div>
								<table width="100%" border="0">
									<tr class="PBAOuterTableTitale">
										<td height="35" colspan="2">搜索客户账目流水信息
										</td>
									</tr>
									<tr>
										<td  width="25%"><%@ include file="../custMgmt/CustInput.jsp"%>
											<input type="hidden" id="indicator" name="formBean.indicator" value="-1"/></td>
										<td><strong>单据日期：  </strong><s:textfield id="startDate"
											name="formBean.searchStartTime" cssClass="easyui-datebox"
											data-options="width:100,editable:false" /> &nbsp; 至&nbsp; <s:textfield
											id="endDate" name="formBean.searchEndTime" cssClass="easyui-datebox"
											data-options="width:100,editable:false" /></td>	
									</tr>
									<tr>
										
									</tr>															
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		</s:form>
	</div>
			<div data-options="region:'center',border:false">
			
			<div id="toolbar" style="display: none;">
				<a onclick="searchAcctFlow();" href="javascript:void(0);"
					class="easyui-linkbutton"
					data-options="iconCls:'icon-search',plain:true">查询账目</a> <a
					onclick="downloadAcctFlow();" href="javascript:void(0);"
					class="easyui-linkbutton"
					data-options="iconCls:'icon-print',plain:true">下载账目</a>
			</div>
			<table id="dataGrid">
			</table>
		</div>
</div>	
	
	
</body>
</html>